All Questions
13 questions
4votes
1answer
786views
Enumerating ancestors in XSLT
I've been playing with some genealogical files in XML lately and wanted to create a transform that would list, for each person, the person's name, the count of ancestors, and the list of ancestors. ...
2votes
1answer
47views
Apply classes to selected XHTML elements based on content
I wish to take an XHTML source document (e.g. demo.in.xhtml below) and add class attributes to every td element whose content is ...
4votes
1answer
1kviews
XSL template for converting XML to JSON
I used saxon v9 to profile an XSL transformation which converts XML to JSON. The profiler tells me that the function which escapes certain characters takes about 70% of the total processing time. The ...
2votes
2answers
3kviews
Camel Case strings in XSLT
I have a situation where I am receiving data from a web service and the data is in all caps. I have to convert to HTML and format for display. In this case, we need the string to be normalized. The ...
3votes
1answer
2kviews
Validate XML using XSD, a Catalog Resolver, and JAXP DOM for XSLT
Background As this related question describes, there does not appear to be a canonical way to validate XML files against an XSD then subsequently transform them using an XSL template with file paths ...
3votes
2answers
16kviews
Conditional assignment in XSLT?
I've written some XSLT where I want to assign values to some variables. Depending on whether or not a condition is met, I want the variable to be populated with a computed value and I want it to have ...
2votes
2answers
210views
Appendix answer key template
Goal: Extract all Appendix Titles If Appendix Title is Answer Key call custom solutions template If Not Answer Key call default appendix template XML: ...
4votes
2answers
593views
Transforming XML as it is being generated on a scanner
At work I've recently been tasked with creating an XSLT to transform some XML as it is being generated on a scanner. The point being to disregard some pages that we are not interested in for further ...
1vote
1answer
160views
How can I optimize my XSL file?
I am trying to learn to format XSL more efficiently. I can tell by the definition of duplicate variables and nearly identical templates that I did not create this efficiently at all. How could I ...
1vote
2answers
176views
Using Choose and Apply Templates with Mode, vs Complexless Template Matches
So I have a little XML (Sub)language, it has 3 elements of interest: para, point, and code ...
6votes
1answer
3kviews
XML Schema for an XML representation of CSV
This is intended to be part of a generalised solution to the problem of converting any (with some minor restrictions) CSV content into XML. The restrictions on the CSV, and the purpose of the schema ...
4votes
2answers
3kviews
Making a flat file
Source XML (since I haven't bothered with a schema): ...
5votes
1answer
1kviews
Using XSLT to turn content of WYSIWYG stored in XML into HTML
The CMS I use uses the Xalan XSLT processor which is a XSLT version 1.0 processor. Editors who use WYSIWYG fields within the CMS can save content that will look like either: ...